package cn.javasea.graphql.service;

import cn.javasea.graphql.common.vo.PageInfo;
import cn.javasea.graphql.entity.HouseResources;
import cn.javasea.graphql.vo.Pagination;
import cn.javasea.graphql.vo.TableResult;
import org.springframework.stereotype.Service;

@Service
public class HouseResourcesService {

    public TableResult<HouseResources> queryList(HouseResources houseResources, Integer currentPage, Integer pageSize) {
        PageInfo pageInfo = new PageInfo(10,1,5, null);
        return new TableResult<>(pageInfo.getRecords(), new Pagination(currentPage, pageSize, pageInfo.getTotal()));
    }

    /**
     * 根据id查询房源数据
     *
     * @param id
     * @return
     */
    public HouseResources queryHouseResourcesById(Long id){
        // 调用dubbo中的服务进行查询数据
        HouseResources houseResources = new HouseResources();
        houseResources.setId(1L);
        houseResources.setBuildingUnit("2单元");
        houseResources.setBuildingNum("5栋");
        houseResources.setBuildingFloorNum("24楼");
        return houseResources;
    }
}
